package cuiyt.designpattern.decorator;
/**
 * @author cyt
 * @create 2020-07-20 10:12
 */
public class Test {

    public static void main(String[] args) {

        BaseCoffee espresso = new Espresso();
        System.out.println("一份咖啡  => " + espresso.getDescription() + "  =>  " + espresso.cost());
        BaseCoffee coffee;

        coffee = new Whilte(new Milk(espresso));

        System.out.println("一份牛奶 + 一份白糖的咖啡  => " + coffee.getDescription() + " => " + coffee.cost());

        coffee = new Whilte(new Milk(new Milk(espresso)));

        System.out.println("两份牛奶 + 一份白糖的咖啡  => " + coffee.getDescription() + " => " + coffee.cost());
    }
}
